# _*_ coding: utf-8 _*_
# @Time : 2024-01-22 22:28
# @Author : wf
from openpyxl import Workbook

# 创建workboob
wb = Workbook()
# 创建 sheet页
ws = wb.active
print(ws.title)

# 创建工作簿
ws2 = wb.create_sheet('Sheet1', 1)
# ['Sheet', 'Sheet2', 'Sheet1']
# 会占用sheet1的位置，然后sheet1后移
# ws3 = wb.create_sheet('Sheet2', 1)

ws3 = wb.create_sheet('Sheet2', 2)

# 获取某个sheet
ws4 = wb['Sheet2']
print(ws4.title)

# 移动sheet
wb.move_sheet(ws3, -1)

# 删除sheet
del wb['Sheet2']

print(wb.sheetnames)
